﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.PackageManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.PackageManagement.PackageRecordVMs
{
    public partial class PackageRecordTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._PackageRecord._WoId")]
        public ExcelPropety WoId_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.WoId);
        [Display(Name = "_Model._PackageRecord._WoCode")]
        public ExcelPropety WoCode_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.WoCode);
        [Display(Name = "_Model._PackageRecord._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.ProductId);
        [Display(Name = "_Model._PackageRecord._ProductName")]
        public ExcelPropety ProductName_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.ProductName);
        [Display(Name = "_Model._PackageRecord._Sn")]
        public ExcelPropety Sn_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.Sn);
        [Display(Name = "_Model._PackageRecord._PartSn")]
        public ExcelPropety PartSn_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.PartSn);
        [Display(Name = "_Model._PackageRecord._StartTime")]
        public ExcelPropety StartTime_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.StartTime, true);
        [Display(Name = "_Model._PackageRecord._Package")]
        public ExcelPropety Package_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.PackageId);
        [Display(Name = "_Model._PackageRecord._Remark")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.Remark);
        [Display(Name = "_Model._PackageRecord._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.IsValid);
        [Display(Name = "_Model._PackageRecord._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<PackageRecord>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Package_Excel.DataType = ColumnDataType.ComboBox;
            Package_Excel.ListItems = DC.Set<PackageBank>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class PackageRecordImportVM : BaseImportVM<PackageRecordTemplateVM, PackageRecord>
    {
            //import

    }

}